package com.hnevc.chenqi;

/**
 * 多线程
 * 继承 Thread 类
 * Runnable 接口
 */

public class Example01 {
    public static void main(String[] args) {
       MyThread myThread =new MyThread();
       Thread thread =new Thread(myThread);
       thread.start();
       while (true){
           System.out.println("死循环");
       }
    }
}

class  MyThread implements Runnable{
    @Override
    public void run() {
        while (true){
            System.out.println("Runnable方式线程开启！！！");
        }
    }
}